//
//  LKMineCardTypeChooseView.m
//  YLHelper
//
//  Created by she1323 on 2018/5/11.
//  Copyright © 2018年 she1323. All rights reserved.
//

#import "LKMineCardTypeChooseView.h"

@implementation LKMineCardTypeChooseView


-(void)awakeFromNib{
    [super awakeFromNib];
    self.typeStr = @"defaultV";
    UITapGestureRecognizer *leftTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(leftOrRightTapAction:)];
    [self.leftImageVIew addGestureRecognizer:leftTap];
    UITapGestureRecognizer *rightTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(leftOrRightTapAction:)];
    [self.rigthImageView addGestureRecognizer:rightTap];
}
-(instancetype)initWithCoder:(NSCoder *)aDecoder{
   self =  [super initWithCoder:aDecoder];
    if (self) {

    }
    return self;
}
-(void)leftOrRightTapAction:(UITapGestureRecognizer *)tap{
    UIImageView *imageView = (UIImageView *)tap.view;
    if (imageView == self.leftImageVIew) {
        self.leftImageVIew.layer.borderColor = [UIColor yellowColor].CGColor;
        self.rigthImageView.layer.borderColor = [UIColor whiteColor].CGColor;
        self.typeStr = @"defaultV";
    }else{
        self.rigthImageView.layer.borderColor = [UIColor yellowColor].CGColor;
        self.leftImageVIew.layer.borderColor = [UIColor whiteColor].CGColor;
        self.typeStr = @"otherV";
    }
    imageView.layer.borderWidth = 1;
    [[NSNotificationCenter defaultCenter] postNotificationName:@"mineCardStyleNotice" object:self userInfo:@{@"bool":self.typeStr}];
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
